<h3>Catégories</h3>

<table class="categories">

<?php

foreach ($categories as $category)
{
	$category_url = url_for2('category', array('category' => $category->getId()));
	
	$html = <<<HTML
	<tr class="category">
		<td>
			<a href="{$category_url}">{$category->getName()}</a>
		</td>
	</tr>
HTML;

	foreach ($category->getCategorySubcategories() as $subcategory)
	{
		$subcategory_url = url_for2('subcategory', array('subcategory' => $subcategory->getId(), 'page' => 1));
		 
		$html .= <<<HTML
			<tr class="subcategory">
				<td>
					<a href="{$subcategory_url}">{$subcategory->getName()}</a>
				</td>
			</tr>
HTML;
	}

	echo $html;
}

?>

</table>

<?php
/*
echo "<pre>";
print_r($read->toArray());
echo "</pre>";
*/
?>